<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" 
	import="java.util.List,com.telecom.cms.dao.*,com.telecom.cms.dto.*" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
<head>
	<title>JSP for SysTeamForm form</title>
	<LINK href="css/default.css" rel=stylesheet>
	<LINK href="css/button.css" rel=stylesheet>
	<LINK href="css/main.css" type=text/css rel=stylesheet>
	<script type="text/javascript" src="js/dtree.js"></script>
<script type="text/javascript">
	function opchange(o){
		if(o=="doQuery"){
			<%
				IdaTemplate tmpt = (IdaTemplate)request.getAttribute("idaTemplate");
				List atomList = tmpt.getAtomList();
				for (int i = 0; i < atomList.size(); i++){
					String isNotEmpty = "";
					String showType = "";
					String pName = "";
					String pNameCn = "";
					if (tmpt.getTemplateTypeId().equals("10")){
						IdaTemplateAtomParam param = (IdaTemplateAtomParam)atomList.get(i);
						isNotEmpty = param.getIsNotEmpty();
						showType = param.getShowTypeId();
						pName = String.valueOf(param.getBizAtomId());
						pNameCn = param.getBizAtomName().trim();
					}
					if (tmpt.getTemplateTypeId().equals("30")){
						IdaTemplateAtomSql param = (IdaTemplateAtomSql)atomList.get(i);
						isNotEmpty = param.getIsNotEmpty();
						showType = param.getShowTypeId();
						pName = param.getParamName();
						pNameCn = param.getParamNameCn().trim();
					}
					if (isNotEmpty.equals("10")){
						out.print("var obj = document.getElementsByName('" + pName + "');");
						out.print("var flag = '0';");
						out.print("for (var i = 0; i < obj.length; i++){");
						if (showType.equals("10") || showType.equals("11") || showType.equals("14") || showType.equals("16"))
							out.print("if (obj[i].value != ''){ flag='1'; break; }");
						else if (showType.equals("12") || showType.equals("13") || showType.equals("15") || showType.equals("17"))
							out.print("if (obj[i].checked==true){ flag='1'; break; }");
						out.print("}");
						out.print("if (flag=='0'){");
						out.print("document.getElementById('span" + pName + "').innerHTML='&nbsp;" + pNameCn + "不能为空';");
						out.print("return false;");
						out.print("}");
						out.print("else { document.getElementById('span" + pName + "').innerHTML=''; }");
					}
				}
			%>
		}
		var obj=document.all.ObjSelect;
		for(i=0;i<obj.length;i++){
			obj.options[i].selected=true;
		}
		document.idaTemplateForm.method.value=o;
		document.idaTemplateForm.submit();
	}
	
	function pupl(o){
		if(o.checked)
			document.getElementById("shoucang").style.display="";
		else
			document.getElementById("shoucang").style.display="none";
	}

	function Atomoption (text,value){
		this.text=text;
		this.value=value;
	}
	
	var atoms=new Array();
	
	function ChangeGroup()
	{ 
		var i,iGroupIndex;
		iGroupIndex=document.all.groups.selectedIndex;
		iAtomCount=0; 
		while (atoms[iGroupIndex][iAtomCount]!=null) 
		 iAtomCount++;
		 //计算选定组下的原子个数 
		document.all.SrcSelect.length=0;//清空选项数 
		var obj=document.all.ObjSelect;
		var objCount=obj.length;
		for(i=0;i<=iAtomCount-1;i++){//改变下拉菜单的内容 
			var flag=0;
			for(j=0;j<=objCount-1;j++){
				var ov = obj.options[j].value.split("#");
				if(ov[0]==atoms[iGroupIndex][i].value){
					flag++;
				}
			}
			if(flag==0)
			document.all.SrcSelect.add(new Option(atoms[iGroupIndex][i].text,atoms[iGroupIndex][i].value));
		}
		document.all.SrcSelect.focus();
	}
	
	function moveUp()  
	{ 
	var theObj=document.all.ObjSelect;
	for(var i=1;i<theObj.length;i++)
	 {
	  if( theObj.options[i].selected && !theObj.options[i-1].selected )
	  {
	   theObj.options[i].swapNode(theObj.options[i-1]);//与上面一个交换
	  }
	 }
	}
	  
	function moveDown()
	{ 
	var theObj=document.all.ObjSelect;
	for(var i=theObj.length-2;i>-1;i--)
	 {
	  if( theObj.options[i].selected && !theObj.options[i+1].selected )
	  {
	   theObj.options[i].swapNode(theObj.options[i+1]);
	  }
	 }
	}
	
	function moveLeftOrRight(fromObj,toObj)
	{
	 var lengthOfToObj=toObj.length;
	 for(var i=fromObj.length-1;i>-1;i--)
	 {
	  if(fromObj.options[i].selected)
	  {
	   toObj.add(new Option(fromObj.options[i].text,fromObj.options[i].value),lengthOfToObj);//new option(text,value,true,true)
	   toObj.options[lengthOfToObj].selected=true;
	   fromObj.options[i].removeNode(true);
	  }
	 }
	}
	
	function changeOrderRule(sel){
		var i=sel.selectedIndex;
		var value=sel.options[i].value;
		var text=sel.options[i].innerHTML;
		vstate=value.split("#");
		tstate=text.split("[");
		if(vstate[1]==null){
		sel.options[i].value=vstate[0]+"#asc";
		sel.options[i].innerHTML=tstate[0]+"[正序]";
		}
		if(vstate[1]=="asc"){
		sel.options[i].value=vstate[0]+"#desc";
		sel.options[i].innerHTML=tstate[0]+"[逆序]";
		}
		if(vstate[1]=="desc"){
		sel.options[i].value=vstate[0];
		sel.options[i].innerHTML=tstate[0];
		}
	}
	
	function changeParent(tree,nodeId){
		return; //暂时关闭此功能
		aNodes = tree.aNodes;
		truenodeid=nodeId.id.substring(tree.obj.length);
		//checked = document.getElementById(nodeId).checked;
		checked = nodeId.checked;
		if(checked){
			for(var i=0;i<aNodes.length;i++){
				if(aNodes[i].id == aNodes[truenodeid].pid){
					document.getElementById(tree.obj+i).checked = checked;
					changeParent(tree,document.getElementById(tree.obj+i));
					break;
				}
			}
		}else{
	  	sign = 0;
			for(var i=0;i<aNodes.length;i++){
				if(aNodes[i].pid == aNodes[truenodeid].pid){
					if(document.getElementById(tree.obj+i).checked){
						sign = 1;
						break;
					}
				}
			}
			if(sign == 0){
				for(var i=0;i<aNodes.length;i++){
					if(aNodes[i].id == aNodes[truenodeid].pid){
						document.getElementById(tree.obj+i).checked = checked;
						changeParent(tree,document.getElementById(tree.obj+i));
						break;
					}
				}
			}
		}
	}

	function changeChild(tree,nodeId){
	  //alert("tree is : "+tree.obj.length+" nodeid is :"+nodeId.id );
	  //truenodeid=nodeId.id.substring(tree.obj.length);
	  aNodes = tree.aNodes;
		//checked = document.getElementById(nodeId).checked;
		//alert(" nodeid is :"+nodeId );
		checked = nodeId.checked;
		//alert("tree is :  nodeid is :"+nodeId+" checked is:"+checked);
		for(var i=0;i<aNodes.length;i++){
		   // if(i>11) 
		   //   alert("pid is "+aNodes[i].pid+" & truenodeid is "+nodeId.id.substring(tree.obj.length)+" &id is "+aNodes[nodeId.id.substring(tree.obj.length)].id);
			if(aNodes[i].pid == aNodes[nodeId.id.substring(tree.obj.length)].id){
				document.getElementById(tree.obj+i).checked = checked;
				//alert(tree.obj+i);
				changeChild(tree, document.getElementById(tree.obj+i));
				//alert("return "+document.getElementById(tree.obj+i));
			}
			//else
			// alert (" why here?");
		}
	}
	
	function showHiddenDiv(id){
		var divstyle=document.getElementById(id).style.display;
		if(divstyle=="none"){
			document.getElementById(id).style.display="";
		}else{
			document.getElementById(id).style.display="none";
		}
	}
	
	function searchField(){
		document.all.SrcSelect.length=0;
		var key=document.getElementById("field").value;
		if(key){
			var count=0;
			for(i=0;i<atoms.length;i++){
				data=atoms[i];
				for(j=0;j<atoms[i].length;j++){
					result=atoms[i][j].text.indexOf(key)
					if(result>-1){
						document.all.SrcSelect.add(new Option(atoms[i][j].text,atoms[i][j].value));
						count++;
					}
				}
			}
		}
	}
</script>

<!-- 日期选择控件 -->
<script language="javascript" type="text/javascript">
var date_start,date_end,g_object
var today = new Date();
var separator="-";
var inover=false;

function change_date(temp,mode)
{
	var t_month,t_year
    if (mode){
        if(mode==1)
        t_month=parseInt(cele_date_month.value,10)+parseInt(temp,10);
        else
        t_month=parseInt(temp)
        if (t_month<cele_date_month.options(0).text) {
            cele_date_month.value=cele_date_month.options(cele_date_month.length-1).text;
            change_date(parseInt(cele_date_year.value,10)-1,0);
            }
        else{
            if (t_month>cele_date_month.options(cele_date_month.length-1).text){
                cele_date_month.value=cele_date_month.options(0).text;
                change_date(parseInt(cele_date_year.value,10)+1,0);
                }            
            else
                {cele_date_month.value=t_month;
                 set_cele_date(cele_date_year.value,cele_date_month.value);                
                }
        }
    }  
    else{
        t_year=parseInt(temp,10);
        
        if (t_year<cele_date_year.options(0).text) {
            cele_date_year.value=cele_date_year.options(0).text;
            set_cele_date(cele_date_year.value,1);                
            }
        else{
            if (parseInt(t_year,10)>parseInt(cele_date_year.options(cele_date_year.length-1).text,10)){
                cele_date_year.value=cele_date_year.options(cele_date_year.length-1).text;
                set_cele_date(cele_date_year.value,12);                
                }            
            else
                {cele_date_year.value=t_year;
                 set_cele_date(cele_date_year.value,cele_date_month.value);                
                }
        }
    }

    window.cele_date.focus();

}

function init(d_start,d_end)
{
     var temp_str;
     var i=0
     var j=0
     date_start=new Date(1980,7,1)
     date_end=new Date(2004,8,1)
     document.writeln("<div name=\"cele_date\" id=\"cele_date\"  style=\"display:none\"    style=\"LEFT: 69px; POSITION: absolute; TOP: 159px;Z-INDEX:99\" onClick=\"event.cancelBubble=true;\" onBlur=\"hilayer()\" onMouseout=\"lostlayerfocus()\">-</div>");
     window.cele_date.innerHTML="";
     temp_str="<table border=\"1\" bgcolor=\"#DDDDDD\" bordercolor=\"white\"><tr><td colspan=7 onmouseover=\"overcolor(this)\">";
     temp_str+="<input type=\"Button\" value=\"<<\" onclick=\"change_date(-1,1)\" onmouseover=\"getlayerfocus()\" style=\"color: #000099; background-color: #BFBFBF; cursor: hand\">-";

     temp_str+=""
     temp_str+="<select name=\"cele_date_year\" id=\"cele_date_year\" language=\"javascript\" onchange=\"change_date(this.value,0)\" onmouseover=\"getlayerfocus()\" onblur=\"getlayerfocus()\" style=\"font-size: 9pt; border: 1px #666666 outset; background-color: #F4F8FB\">"

     for (i=1949;i<=2049;i++)
     {
     	temp_str+="<OPTION value=\""+i.toString()+"\">"+i.toString()+"</OPTION>";
     }
     temp_str+="</select>-";
     temp_str+=""
     temp_str+="<select name=\"cele_date_month\" id=\"cele_date_month\" language=\"javascript\" onchange=\"change_date(this.value,2)\" onmouseover=\"getlayerfocus()\" onblur=\"getlayerfocus()\" style=\"font-size: 9pt; border: 1px #666666 outset; background-color: #F4F8FB\">"

     for (i=1;i<=12;i++)
     {
     	temp_str+="<OPTION value=\""+i.toString()+"\">"+i.toString()+"</OPTION>";
     }
     temp_str+="</select>-";
     temp_str+=""
     temp_str+="<input type=\"Button\" value=\">>\" onclick=\"change_date(1,1)\" onmouseover=\"getlayerfocus()\"  style=\"color: #000099; background-color: #BFBFBF; cursor: hand\">";

     temp_str+="</td></tr><tr><td onmouseover=\"overcolor(this)\">"
     temp_str+="<font color=red>日</font></td><td>";temp_str+="一</td><td>"; temp_str+="二</td><td>"; temp_str+="三</td><td>"
     temp_str+="四</td><td>";temp_str+="五</td><td>"; temp_str+="六</td></tr>";
     for (i=1 ;i<=6 ;i++)
     {
     temp_str+="<tr>";
        for(j=1;j<=7;j++){
            temp_str+="<td name=\"c"+i+"_"+j+"\"id=\"c"+i+"_"+j+"\" style=\"CURSOR: hand\" style=\"COLOR:#000000\" language=\"javascript\" onmouseover=\"overcolor(this)\" onmouseout=\"outcolor(this)\" onclick=\"td_click(this)\">?</td>"
            }
     temp_str+="</tr>"        
     }
     temp_str+="</td></tr></table>";
     window.cele_date.innerHTML=temp_str;
}
function set_cele_date(year,month)
{
   var i,j,p,k
   var nd=new Date(year,month-1,1);
   event.cancelBubble=true;
   cele_date_year.value=year;
   cele_date_month.value=month;   
   k=nd.getDay()-1
   var temp;
   for (i=1;i<=6;i++)
      for(j=1;j<=7;j++)
      {
      eval("c"+i+"_"+j+".innerHTML=\"\"");
      eval("c"+i+"_"+j+".bgColor=\"#DDDDDD\"");
      eval("c"+i+"_"+j+".style.cursor=\"hand\"");
      }
   while(month-1==nd.getMonth())
    { j=(nd.getDay() +1);
      p=parseInt((nd.getDate()+k) / 7)+1;
      eval("c"+p+"_"+j+".innerHTML="+"\""+nd.getDate()+"\"");
      if ((nd.getDate()==today.getDate())&&(cele_date_month.value==today.getMonth()+1)&&(cele_date_year.value==today.getYear())){
      	 eval("c"+p+"_"+j+".bgColor=\"#EFFB64\"");
      }
      if (nd>date_end || nd<date_start)
      {
      eval("c"+p+"_"+j+".bgColor=\"#FF9999\"");
      eval("c"+p+"_"+j+".style.cursor=\"text\"");
      }
      nd=new Date(nd.valueOf() + 86400000)
    }
}


function show_cele_date(eP,d_start,d_end,t_object)
{
eP=document.getElementById(t_object);
window.cele_date.style.display="";
window.cele_date.style.zIndex=99
var s,cur_d
var eT = eP.offsetTop;  
var eH = eP.offsetHeight+eT;  
var dH = window.cele_date.style.pixelHeight;  
var sT = document.body.scrollTop; 
var sL = document.body.scrollLeft; 
event.cancelBubble=true;
window.cele_date.style.posLeft = event.clientX-event.offsetX+sL-5;  
window.cele_date.style.posTop = event.clientY-event.offsetY+eH+sT-5;
if (window.cele_date.style.posLeft+window.cele_date.clientWidth>document.body.clientWidth) window.cele_date.style.posLeft+=eP.offsetWidth-window.cele_date.clientWidth;
if (d_start!=""){
    if (d_start=="today"){
        date_start=new Date(today.getYear(),today.getMonth(),today.getDate());
    }else{
        s=d_start.split(separator);
        date_start=new Date(s[0],s[1]-1,s[2]);
    }
}else{
    date_start=new Date(1949,1,1);
}

if (d_end!=""){
    s=d_end.split(separator);
    date_end=new Date(s[0],s[1]-1,s[2]);
}else{
    date_end=new Date(3000,1,1);
}

//g_object=t_object
g_object=document.getElementById(t_object);

cur_d=new Date()
set_cele_date(cur_d.getYear(),cur_d.getMonth()+1);
window.cele_date.style.display="block";

window.cele_date.focus();

}
function td_click(t_object)
{
var t_d
if (parseInt(t_object.innerHTML,10)>=1 && parseInt(t_object.innerHTML,10)<=31 ) 
{ t_d=new Date(cele_date_year.value,cele_date_month.value-1,t_object.innerHTML)
if (t_d<=date_end && t_d>=date_start)
{
var year = cele_date_year.value;
var month = cele_date_month.value;
var day = t_object.innerHTML;
if (parseInt(month)<10) month = "0" + month;
if (parseInt(day)<10) day = "0" + day;

g_object.value=year+separator+month+separator+day;
window.cele_date.style.display="none";};
}

}
function h_cele_date()
{
window.cele_date.style.display="none";
}

function overcolor(obj)
{
  if (obj.style.cursor=="hand") obj.style.color = "#FFFFFF";

  inover=true;
  window.cele_date.focus();

}

function outcolor(obj)
{
	obj.style.color = "#000000";
	inover=false;

}

function getNow(o){
    var Stamp=new Date();
    var year = Stamp.getYear();
    var month = Stamp.getMonth()+1;
    var day = Stamp.getDate();
    if(month<10){
	month="0"+month;
    }
    if(day<10){
	day="0"+day;
    }
    o.value=year+separator+month+separator+day;
}

function hilayer()
{
	if (inover==false)
	{
		var lay=document.all.cele_date;
		lay.style.display="none";
	}
}
function getlayerfocus()
{
	inover=true;
}
function lostlayerfocus()
{
	inover=false;
}
init();
</script>
</head>
<body>
<html:form action="/ida">
<table width="770" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
	<tr>
		<td width="3" height="31">
			<img height="31" src="./images/table_01.gif" width="3" />
		</td>
		<td background="./images/table_02.gif" height="31">
			<table cellspacing="0" cellpadding="0" width="231" align="left" border="0">
				<tbody>
					<tr>
						<td width="51" background="./images/title_1_bg.gif">
							<img height="31" src="./images/title_1.gif" width="51" />
						</td>
						<td width="180" background="./images/title_1_bg.gif">
							<span class="color_b_666">${idaTemplate.templateName}</span>
						</td>
					</tr>
				</tbody>
			</table>
		</td>
		<td width="3">
			<img height="31" src="./images/table_03.gif" width="3" />
		</td>
	</tr>
	<tr>
		<td background="images/table_04.gif">
			<img height="5" src="images/table_04.gif" width="3">
		</td>
		<td style="PADDING-TOP: 3px" valign="top">
		<logic:present name="idaTemplate" scope="request">
			<table width='100%' border='0' cellspacing='' cellpadding='2'>
				<tr>
					<td align="left" colspan="2">
						<table width='100%' border='0' cellspacing='1' cellpadding='2'>
							${paramStr}
						</table>
					</td>
				</tr>
				<tr>
					<td align="left" colspan="2">
						<table width='100%' border='0' cellspacing='0' cellpadding='2'>
							<tr align="center" height="25">
								<td background="images/atom_02.gif" width="20%">结果字段类型：</td>
								<td background="images/atom_02.gif" width="25%">可选择结果字段：</td>
								<td background="images/atom_02.gif" width="10%">&nbsp;</td>
								<td background="images/atom_02.gif" width="25%">已选择结果字段：</td>
								<td background="images/atom_02.gif" width="20%">&nbsp;</td>
							</tr>
							<tr align="center" valign="top">
								<td>
									<select name="groups" id="groups" onchange="ChangeGroup()">
									<%
										IdaDAO idadao = new IdaDAO();
										List grouplist = idadao.findAllAtomGroup();
										int idx = 0;
										for (int i = 0; i < grouplist.size(); i++) {
											SEG_BIZ_GROUP_DEFDTO groupdto = (SEG_BIZ_GROUP_DEFDTO) grouplist.get(i);
											SEG_BOOKMARK_DEFDTO bookmark = idadao.findBookmark(groupdto.getBOOKMARK_ID());
											if (bookmark.getCLASS_ID() != 1 && bookmark.getCLASS_ID() != 2)
												continue;
									%>
										<option value=<%=groupdto.getATOM_GROUP_ID()%>><%=bookmark.getBOOKMARK_NAME() + "→" + groupdto.getATOM_GROUP_NAME()%></option>
										<script type="text/javascript">atoms[<%=idx%>]=new Array(); </script>
										<%
											List groupAtoms = idadao.findGroupAtoms(groupdto.getATOM_GROUP_ID());
											if (groupAtoms != null && groupAtoms.size() > 0)
												for (int j = 0; j < groupAtoms.size(); j++) {
													SEG_BIZ_ATOM_DEFDTO showdto = (SEG_BIZ_ATOM_DEFDTO)groupAtoms.get(j);
										%>
										<script type="text/javascript">atoms[<%=idx%>][<%=j%>]=new Atomoption('<%=showdto.getBIZ_ATOM_NAME()%>',<%=showdto.getBIZ_ATOM_ID()%>) </script>
									<%
											}
											idx++;
										}
									%>
									</select>&nbsp;
									<br/>
									搜索字段：
									<input type="text" name="field" onpropertychange="searchField()" size="15">
									<br/><br/>
									<div align='left' style="display: none;" id="multimonth" style='height: 160px; overflow-y: auto;'>
										请选择您要查看的帐务月：
										<logic:present name="billingCycleIdList" scope="request">
											<logic:iterate name="billingCycleIdList" id="month">
												<input type="checkbox" name="viewMonth" value="${month}">${month}&nbsp;&nbsp;<br>
											</logic:iterate>
										</logic:present>
									</div>
								</td>
								<td>
									<select name="SrcSelect" size=15 style="font-size: 10pt; width: 200px;" multiple>
									</select>
								</td>
								<td align="center" valign="middle">
									<a href="javascript:moveLeftOrRight(document.all.SrcSelect,document.all.ObjSelect)"><img src="images/button_add_arrow.gif" border="0"></a>
									<br><br>
									<a href="javascript:moveLeftOrRight(document.all.ObjSelect,document.all.SrcSelect)"><img src="images/button_del_arrow.gif" border="0"></a>
								</td>
								<td>
									<select name="ObjSelect" ondblclick="changeOrderRule(this)" size=15 style="font-size: 10pt; width: 200px;" multiple title="提示：双击结果字段可对选择的结果字段排序">
										<%
											IdaTemplate rsTemplate = (IdaTemplate)request.getAttribute("resultTemplate");
											List rsAtomList = rsTemplate.getAtomList();
											for (int i = 0; i < rsAtomList.size(); i++){
												IdaTemplateAtomResult atom = (IdaTemplateAtomResult)rsAtomList.get(i);
												String vo = "";
												String to = atom.getResultOrderRule();
												if(to.equals("asc")){
													to="正序";
												}else if(to.equals("desc")){
													to="逆序";
												}
												if (atom.getResultOrderRule() != null && !atom.getResultOrderRule().equals("")){
													vo = "#" + atom.getResultOrderRule();
													to = "[" + to + "]";
												}
										%>
											<option value="<%=atom.getBizAtomId() + vo%>"><%=atom.getBizAtomName() + to%></option>
										<% } %>
									</select>
								</td>
								<td align="left">
									<a href="javascript:moveUp()"><img src="images/button_up.gif" border="0"></a>
									<br><br>
									<a href="javascript:moveDown()"><img src="images/button_down.gif" border="0"></a>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td align="center" width="20%">
						<div align='center'>
							<input type="checkbox" name="viewMultiMonth" value="T" onclick="showHiddenDiv('multimonth')">查看多个帐务月数据
						</div>
					</td>
					<td align="center" width="80%">
						<div align="center" id="commit">
							<input type="radio" name="queryType" value="10" checked>清单数据&nbsp;&nbsp;
							<input type="radio" name="queryType" value="20">汇总数据&nbsp;&nbsp;&nbsp;&nbsp;
							<input type="button" onclick="opchange('doQuery')" value="提交取数">&nbsp;&nbsp;
							<input type="checkbox" name="checkshoucang" id="checkshoucang" onclick="pupl(this)">实例化我的取数
						</div>
					</td>
				</tr>
				<tr>
					<td align="center" colspan="2">
						<div style="display: none;" id="shoucang">
							<br>请输入取数实例的名称：&nbsp;&nbsp;
							<input type="text" name="instanceName" value="${idaTemplate.templateName}" size="40">&nbsp;&nbsp;
							<input type="checkbox" name="rewriteInst" value="T" checked>覆盖同名实例&nbsp;&nbsp;
							<input type="checkbox" name="deleteInst" value="T">删除该模板的实例&nbsp;&nbsp;
							<input type="button" onclick="opchange('saveInstance')" value="确  定">
						</div> 
					</td>
				</tr>
			</table>
		</logic:present>
		</td>
		<td background="images/table_05.gif">
			<img height="5" src="images/table_05.gif" width="3">
		</td>
	</tr>
	<tr height="3">
		<td height="3">
			<img height="12" src="images/table_06.gif" width="3">
		</td>
		<td height="3">
			<img height="3" src="images/table_07.gif" width="764">
		</td>
		<td height="3">
			<img height="12" src="images/table_08.gif" width="3">
		</td>
	</tr>
</tbody>
</table>
<br />
<html:hidden property="method" value="doQuery" />
<html:hidden property="templateId" value="${idaTemplate.templateId}" />
</html:form>
<script type="text/javascript">
	document.all.groups.selectedIndex=0;
	ChangeGroup();
</script>
</body>
</html>